<div class="form-wrapper">
	<div class="form-header"><?php echo lang('subject_edit_header'); ?></div>
	<?php if (validation_errors()): ?>
	<div class="error-box">
		<?php echo validation_errors();?>
	</div>
	<?php endif; ?>
    
	<?php echo form_open(site_url('grading/subjects/edit/'.$subject->id)); ?>
	<label for="subject_code"><?php echo lang('subject_code'); ?></label>
	<input type="text" autocomplete="off" class="ipt-txt full-width" name="code" value="<?php echo $subject->code; ?>" />
	<br/>
	<label for="subject_name"><?php echo lang('subject_name'); ?></label>
	<input type="text" autocomplete="off" class="ipt-txt full-width" name="name" value="<?php echo $subject->name;?>" />
	<br/>
	<label for="subject_description"><?php echo lang('subject_description'); ?></label>
	<?php echo form_textarea(array('name'=>'description','class'=>'full-width','rows'=>'5','cols'=>'65','value'=>$subject->description)); ?>
    <br/>
	<label for="subject_category"><?php echo lang('subject_category'); ?></label>
	<?php echo form_dropdown('category',$categories,$subject->category_id,"id='category'"); ?>
	<br/>
	<label for="subject_year_level"><?php echo lang('subject_year_level'); ?></label>
	<?php echo form_dropdown('year_level',$year_level,$subject->school_level_id,"id='year_level'"); ?>
	<br/>
	<label for="subject_is_active"><?php echo lang('subject_is_active'); ?></label>
	<input type="checkbox" name="is_active" <?php echo($subject->is_active) ? 'checked="checked"' : ''; ?> value="1"/>
	<br/>
	<fieldset id="action">
	<a href="#" class="btn btn-save"><span class="btn-icon disk-icon"></span><?php echo lang('subject_update_button'); ?></a>
    <a href="<?php echo site_url('grading/subjects'); ?>" class="btn btn-cancel"><span class="btn-icon cancel-icon"></span><?php echo lang('subject_cancel_button'); ?></a>
	</fieldset>
	<?php echo form_close(); ?>
</div>
<script>
	$('.btn-save').click(function(){
		$('form').submit();
		return false;
	});
</script>